package sharetime.playlist.domain;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import sharetime.core.EntityObject;
import sharetime.user.domain.UserData;

@Entity
@Table(name = "playlist_comment")
public class PlaylistComment extends EntityObject {

	private static final long serialVersionUID = 7544828420240929139L;
	private String title;
	private Date date;
	private String body;

	private Playlist playlist;
	private UserData owner;

	/**
	 * Gets the value of title
	 * 
	 * @return the value of title
	 */
	public String getTitle() {
		return this.title;
	}

	/**
	 * Sets the value of title
	 * 
	 * @param argTitle
	 *            Value to assign to this.title
	 */
	public void setTitle(String argTitle) {
		this.title = argTitle;
	}

	/**
	 * Gets the value of date
	 * 
	 * @return the value of date
	 */
	public Date getDate() {
		return this.date;
	}

	/**
	 * Sets the value of date
	 * 
	 * @param argDate
	 *            Value to assign to this.date
	 */
	public void setDate(Date argDate) {
		this.date = argDate;
	}

	/**
	 * Gets the value of body
	 * 
	 * @return the value of body
	 */
	public String getBody() {
		return this.body;
	}

	/**
	 * Sets the value of body
	 * 
	 * @param argBody
	 *            Value to assign to this.body
	 */
	public void setBody(String argBody) {
		this.body = argBody;
	}

	/**
	 * Gets the value of playlist
	 * 
	 * @return the value of playlist
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fk_playlist_id")
	public Playlist getPlaylist() {
		return this.playlist;
	}

	/**
	 * Sets the value of playlist
	 * 
	 * @param argPlaylist
	 *            Value to assign to this.playlist
	 */
	public void setPlaylist(Playlist argPlaylist) {
		this.playlist = argPlaylist;
	}

	/**
	 * Gets the value of owner
	 * 
	 * @return the value of owner
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fk_userdata_id")
	public UserData getOwner() {
		return this.owner;
	}

	/**
	 * Sets the value of owner
	 * 
	 * @param argOwner
	 *            Value to assign to this.owner
	 */
	public void setOwner(UserData argOwner) {
		this.owner = argOwner;
	}

	@Override
	public String toString() {
		return this.title;
	}
}
